Stored Procedures [dbo].[asi_DocumentMainListByParentPath]
Properties
PropertyValue
ANSI Nulls OnYes
Quoted Identifier OnYes
Parameters
NameData TypeMax Length (Bytes)
@documentPathnvarchar(2000)4000
@organizationKeyuniqueidentifier16
@userKeyuniqueidentifier16
@loggedInUserGroupKeyuniqueidentifier16
@publishedOnlybit1
@ignoreLicensingbit1
SQL Script

/*
Given a path to a folder, returns all documents in that folder. Security IS checked. The first
segment of the documentPath should be the DocumentRoot name. The last segment should be the DocumentName of the folder
for which contents are desired. Individual segments are separated by the forward slash (/)

Returns:
Everything from the DocumentMain table except the blob. Also includes DocumentTypeName, DocumentTypeDesc,
and DocumentIconURL from DocumentTypeRef and HierarchyKey from the Hierarchy element representing the document.
*/

CREATE PROC [dbo].[asi_DocumentMainListByParentPath]
   @documentPath nvarchar(2000),
   @organizationKey uniqueidentifier,
   @userKey uniqueidentifier,
   @loggedInUserGroupKey uniqueidentifier = '00000000-0000-0000-0000-000000000000', -- if this is empty, we assume the user is not logged in
   @publishedOnly bit = 0,
   @ignoreLicensing bit = 0
AS
BEGIN
   DECLARE
      @rootHierarchyKey uniqueidentifier,
      @hierarchyKey uniqueidentifier,
      @documentVersionKey uniqueidentifier,
      @documentKey uniqueidentifier

   EXEC asi_DocumentKeysByPath @documentPath, @organizationKey, @userKey, @loggedInUserGroupKey, @ignoreLicensing, @rootHierarchyKey out, @hierarchyKey out, @documentVersionKey out, @documentKey out

   EXEC asi_DocumentMainListByParentHierarchyKey @hierarchyKey, @userKey, @loggedInUserGroupKey, @publishedOnly, @ignoreLicensing
END


GO
Uses